<?php
namespace Forms\Validator;

use Pinenut\Form\Validator;

class CheckRecoveryCodeAction extends Validator
{
	protected $defaultErrorMessage = 'Invalid recovery code';

	protected function isValid($value, $params)
	{
		$className = $params['className'];
		/* @var $className \Pinenut\User\Auth\EmailPassword */
		return $className::checkRecoveryCode($params['masterValue'], $value);
	}
}